<template>
  <el-table :data="workflow_approval_list" style="width: 100%">
    <el-table-column prop="name" label="Name" width="180" />
    <el-table-column prop="workflow_name" label="申请类型" width="180" />
    <el-table-column prop="admin_name" label="申请人" width="180" />
    <el-table-column>
      <template #default="scope">
        <el-button @click="router.push({path: '/workflow_approval_detail', query: {id:scope.row.id}})">审批</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script setup>
  import { ref, onMounted } from "vue"
  import {useRoute, useRouter } from "vue-router";
  import http from "../http"

  const route = useRoute()
  const router = useRouter()

  let workflow_approval_list = ref([])

  const getWorkflowApprovalList = () => {
    http.get(`workflow/task_list/`)
    .then(res=>{
      console.log(res)
      workflow_approval_list.value = res.data
    })
    .catch(error=>{
      console.log(error)
    })
  }

  onMounted(()=>{
    getWorkflowApprovalList()
  })

</script>
